<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7">
<title>新用户注册 - 返利网</title>
<link rel="stylesheet" type="text/css" href="./css/reg_css.css">
<script type="text/javascript" src="./common/jquery-1.6.4.min.js"></script>
<script type="text/javascript" src="./common/messagebox.js"></script>
</head>
<body>
<style>
body{text-align:left;}
.qq_denglu {float:right;font-weight:normal;margin:0 20px 0 0;line-height:20px;}
.qq_denglu span {color:#8E8E8E;font-size:12px;}
.qq_denglu img {position:relative;top:3px;}
.zhuce_mianfeizc_text li {margin-bottom:30px;}
</style>
<script language="javascript" type="text/javascript">
var b_name_valid = false;
var b_email_valid = false;

function isValidEmail(str){
	var filter = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
	if (filter.test(str)){return true;}else{return false;}
}

function isValidName(str){//只允许字母,数字,汉字和下划线
	var filter = /^[\u4e00-\u9fa5a-zA-Z_0-9]+$/;  
	if(filter.test(str)){return true;}else{return false;}
}

function reg_chkname(action){
	var namevalue = $("#user"+action).val();
	switch (action){
		case "email":
			if(checkspace(namevalue)) {
				$("#"+action+"info").html("<span style='color:#EB3F00'>Email不能为空，请重新输入！</span>");
				return false;
			}
			if(!isValidEmail(namevalue)){
				$("#"+action+"info").html("<span style='color:#EB3F00'>Email格式错误</span>");
				return false;
			}
			var checkemail = namevalue.split("@");
			var resultStr = checkemail[1];
			resultStr = resultStr.split(".");
			resultStr = resultStr[0];
			if (resultStr.toLowerCase()=="yahoo"){
				$('#zhuce_mianfeizc_pf_email').show();
				$('#checkemail').html('为确保您及时收到返利网确认邮件,请勿填写yahoo邮箱');
				return false;
			}else{
				$('#checkemail').html('请填写真实邮箱，它是您找回密码及兑现返利的凭证。');
				b_email_valid = true;
			}
			break;
		case "name":
			if(namevalue.length < 3) {
				$("#"+action+"info").html("<span style='color:red'>用户名长度不能小于3，请重新输入！</span>");
				return false;
			}
			if(!isValidName(namevalue)){
				$("#"+action+"info").html("<span style='color:red'>只允许字母,数字,汉字和下划线</span>");
				return false;
			}
			if(checkspace(namevalue)) {
				$("#"+action+"info").html("<span style='color:red'>用户名不能为空，请重新输入！</span>");
				return false;
			}
			b_name_valid = true;
			break;
	}
	var url = "";  //注册URL
	$("#"+action+"info").html("loading...");
	$.ajax({
			url:url,
			dataType:'jsonp',
			jsonp:'jsoncallback',
			success:function(json){
				$("#"+action+"info").html(json.info);
				switch (action){
					case "email":
						b_email_valid = (json.status.toString()=="1") && b_email_valid;
						break;
					case "name":
						b_name_valid = (json.status.toString()=="1") && b_name_valid;
						break;
				};
			}
	})
}

function reg_chkpwd()
{
	var userpassword=$('#UserPassword').val();
	var username=$("#username").val();
	var useremail=$("#useremail").val();

	if(checkspace(userpassword) || userpassword.length<6 ){
		$('#pwdinfo').html('<span style="color:red">为了您的帐户安全，密码长度不能小于6位，请重新输入！</span>');
		return false;
	}
	else if(userpassword==username||userpassword==useremail||userpassword==useremail.split('@')[0]){
		$('#pwdinfo').html("<span style='color:red'>为了您的帐户安全，密码和Email或用户名不能一致，请重新输入！</span>");
		return false;
	}
	else if(chkpwdlv(userpassword)<2){
		$('#pwdinfo').html("<span style='color:red'>为了您的帐户安全，密码必须包含数字和英文，请重新输入！</span>");
		return false;
	}
	else{
		$('#pwdinfo').html('');
		return true;
	}
}

function reg_chkpwd2(){
	if ($("#UserPassword").val()!=$("#UserPassword2").val()){
		$("#pwd2info").html("密码输入不一致");return false;
	}
	else{
		$("#pwd2info").html("");return true;
	}
}

function do_reg(){
	if(!b_email_valid){
		$("#emailinfo").html("<span style='color:#EB3F00'>Email错误</span>");
		return false;
	}
	if(!b_name_valid){
		$("#nameinfo").html("<span style='color:#EB3F00'>用户名错误</span>");
		return false;
	}
	if(!$("#reg_agreement").attr("checked")){
		alert("未同意返利网的使用协议，无法注册！");
		return false;
	}
	return reg_chkpwd() && reg_chkpwd2() && b_email_valid && b_name_valid;
	$("#success").html("<img src='./images/load.gif'>&nbsp;<span style='font-size:14px;'>正在注册，请稍等...</span>"); 
}

//检查密码强度(0密码位数不够1弱2中3强)
function chkpwdlv(str){
	if(str.length<6){
		return 0;//密码位数不足9
	}
	else{
		var d = /\d/, w = /[a-z]/i, s = /[^A-Za-z0-9]/;
		var dl=0,wl=0,sl=0;
		if(str.search(d) != -1){dl=1;}
		if(str.search(w) != -1){wl=1;} 
		if(str.search(s) != -1){sl=3;}
		var pwdlv=dl+wl+sl;
		if(pwdlv>=3){pwdlv=3;}
		return pwdlv;
	}
}

function checkspace(checkstr) {
  return ((checkstr.indexOf(" ")>-1||checkstr.indexOf("　")>-1)?true:false)
}

function showskeyvalidbox(){
	if($("#showskeyinvalid").val()=="1"){
		ShowMessageBox({control:'box_skeyvalid',width:'418',height:'360',title:'',parent:null});
		return false;
	}
}

$(function(){
	showskeyvalidbox();
});
</script>

<div class="denglu">
  <div class="denglu_top"><a href="index.htm"><img src="images/layout/logo-taobao-taodi.png"  /></a></div>
  <div class="zhuce">
    <div class="zhuce_bj_content">

      <div class="zhuce_bj_text">获取返利步骤:<strong>1.注册返利网</strong> > 2.从返利网去商城购买 > 3.回返利网拿返利</div>
      <div class="zhuce_mianfeizc">
        <div class="zhuce_mianfeizc_top"></div>
		<form name="userinfo" method="post" action="#" onsubmit="return do_reg();">
        <div class="zhuce_mianfeizc_content">
          <div class="zhuce_mianfeizc_qiandai"></div>
          <div class="zhuce_mianfeizc_biaoti" style="line-height:20px;"><div class="qq_denglu"><span>您也可以使用以下帐号登录返利网：</span> <a href="#"><img  src="images/111112fanli_icon_14.gif"> 淘宝</a><span style="padding:0 10px;color:#CCC;">|</span><a href="#"><img src="images/111112fanli_icon_16.gif"> QQ</a><span style="padding:0 10px;color:#CCC;">|</span><a href="#"><img src="images/111112fanli_icon_11.gif"> 微博</a></div>免费注册</div>

          <div class="zhuce_mianfeizc_touying"></div>
          <div class="zhuce_mianfeizc_text">
            <ul>
				
				<li>
					<span class="zhuce_mianfeizc_text_span1">Email：</span>
					<span class="zhuce_mianfeizc_text_span2">
						<div style="position:relative">
							<input type="text" name="useremail" id="useremail" class="biankuang2" style="width:200px;height:28px;line-height:28px;padding-left:7px;" onfocus="this.className='biankuang1';$('#zhuce_mianfeizc_pf_email').show();" onblur="this.className='biankuang2';$('#zhuce_mianfeizc_pf_email').hide();reg_chkname('email');" onKeyUp="value=value.replace(/(^\s*)|(\s*$)/g,'')"  maxlength="50" />

							<span id="zhuce_mianfeizc_pf_email" class="zhuce_mianfeizc_pf" style="display:none;">
								<span class="zhuce_mianfeizc_pf_sanjia"><img src="images/zhuce_pic_15.jpg"/></span>
								<span id="checkemail" class="zhuce_mianfeizc_pf_bj">请填写真实邮箱，它是您找回密码及兑现返利的凭证。</span>
								<div style="clear:both"></div>
							</span>
						</div>
						<div class="zhuce_mianfeizc_text_span2_bj"><span style="color:#EB3F00;" id="emailinfo"></span></div>
					</span>

				</li>
				<li>
					<span class="zhuce_mianfeizc_text_span1">用户名：</span>
					<span class="zhuce_mianfeizc_text_span2">
						<div style="position:relative">
							<input type="text" name="username" id="username" class="biankuang2" style="width:200px;height:28px;line-height:28px;padding-left:7px;" onfocus="this.className='biankuang1';$('#zhuce_mianfeizc_pf_username').show();"  onBlur="this.className='biankuang2';$('#zhuce_mianfeizc_pf_username').hide();reg_chkname('name');" maxlength="25" />
							<span id="zhuce_mianfeizc_pf_username" class="zhuce_mianfeizc_pf" style="display:none;">
								<span class="zhuce_mianfeizc_pf_sanjia"><img src="images/zhuce_pic_15.jpg"/></span>

								<span class="zhuce_mianfeizc_pf_bj">用户名不能包含标点符号</span>
								<div style="clear:both"></div>
							</span>
						</div>
						<div class="zhuce_mianfeizc_text_span2_bj"><span style="color:#EB3F00;" id="nameinfo"></span></div>
					</span>
				</li>
				<li>

					<span class="zhuce_mianfeizc_text_span1">密码：</span>
					<span class="zhuce_mianfeizc_text_span2">
						<div style="position:relative">
							<input type="Password" name="UserPassword" id="UserPassword" class="biankuang2" style="width:200px;height:28px;line-height:28px;padding-left:7px;" onfocus="this.className='biankuang1';$('#zhuce_mianfeizc_pf_password').show();" onblur="this.className='biankuang2';$('#zhuce_mianfeizc_pf_password').hide();reg_chkpwd();reg_chkpwd2();" maxlength="25" onpaste="return false"/>
							<span id="zhuce_mianfeizc_pf_password" class="zhuce_mianfeizc_pf" style="display:none;">
								<span class="zhuce_mianfeizc_pf_sanjia"><img src="images/zhuce_pic_15.jpg"/></span>
								<span class="zhuce_mianfeizc_pf_bj">密码长度不能少于6位,必须包含英文和数字</span>
								<div style="clear:both"></div>

							</span>
						</div>
						<div class="zhuce_mianfeizc_text_span2_bj"><span style="color:#EB3F00;" id="pwdinfo"></span></div>
					</span>
				</li>
				<li class="xuxian">
					<span class="zhuce_mianfeizc_text_span1">确认密码：</span>
					<span class="zhuce_mianfeizc_text_span2">

						<div style="position:relative">
							<input type="Password" name="UserPassword2" ID="UserPassword2" class="biankuang2" style="width:200px;height:28px;line-height:28px;padding-left:7px;" onfocus="this.className='biankuang1';" onblur="this.className='biankuang2';reg_chkpwd2();" maxlength="25" onpaste="return false"/>
						</div>
						<div class="zhuce_mianfeizc_text_span2_bj"><span style="color:#EB3F00;" id="pwd2info"></span></div>
					</span>
				</li>
				<li class="bj">
					<span class="zhuce_mianfeizc_text_span1"></span>
					<span class="zhuce_mianfeizc_text_span2">

						<input type="checkbox" name="reg_agreement" id="reg_agreement" value="yes" checked="checked" style="position:relative;top:-2px;"/>
						<label style="cursor:pointer;" for="reg_agreement">我已阅读并且同意返利网的<a href="#" target="_blank">使用协议</a></label>
					</span>
				</li>
				<li>
					<span class="zhuce_mianfeizc_text_span1"></span>
					<span class="zhuce_mianfeizc_text_span2">
						<input type="submit" name="subbt" class="submit2" value=""/>

						<span id="success" style="color:green; margin-left:81px;"></span>
					</span>
				</li>
            </ul>
            <div style="clear:both"></div>
          </div>
        </div>
		</form>
        <div class="zhuce_mianfeizc_bottom"></div>
      </div>

    </div>
  </div>
</div>

</div>
<div style="   margin-top:20px; overflow:hidden; "  >
  <iframe   scrolling="no" marginheight="0" width="100%" height="120" src="footer.htm" frameborder=0></iframe>
</div>

</body>
</html>
